from django import forms
from .models import JobPosition

class JobPositionForm(forms.ModelForm):
    title = forms.CharField(
        label='职位名称',
        widget=forms.TextInput(attrs={
            'class': 'form-control',
            'placeholder': '请输入职位名称',
        })
    )
    company = forms.CharField(
        label='公司名称',
        widget=forms.TextInput(attrs={
            'class': 'form-control',
            'placeholder': '请输入公司名称',
        })
    )
    location = forms.CharField(
        label='工作地点',
        widget=forms.TextInput(attrs={
            'class': 'form-control',
            'placeholder': '例如：北京市朝阳区',
        })
    )
    salary_range = forms.CharField(
        label='薪资范围',
        widget=forms.TextInput(attrs={
            'class': 'form-control',
            'placeholder': '例如：8k-15k',
        })
    )
    description = forms.CharField(
        label='职位描述',
        widget=forms.Textarea(attrs={
            'class': 'form-control',
            'rows': 6,
            'placeholder': '请详细描述职位的主要工作内容、职责等',
        })
    )
    requirements = forms.CharField(
        label='职位要求',
        widget=forms.Textarea(attrs={
            'class': 'form-control',
            'rows': 6,
            'placeholder': '请描述职位所需的技能、经验、学历等要求',
        })
    )

    class Meta:
        model = JobPosition
        fields = ['title', 'company', 'location', 'salary_range', 'description', 'requirements']

